#pragma once
#include <memory>

#include "View.h"
#include "SkCanvas.h"
#include "Animation.h"
class ColorAnimation;

class ConnectTipView :
	public View, public AnimationDelegate
{
public:
	ConnectTipView(View* parent);
	virtual ~ConnectTipView();


	void setConnect(bool connect);
	bool isConnect();
protected:
	virtual bool paint(SkCanvas* canvas);

	// AnimationDelegate
	virtual void animateStarted(Animation* animation);

	virtual void animateCompleted(Animation* animation);

	virtual void animateStep(Animation* animation);

	virtual void animateCanceled(Animation* animation);

	void calcColorAndStartAnimate();

private:
	bool is_connect_;

	SkColor connect_color_1, connect_color_2;
	SkColor disconnect_color_1, disconnect_color_2;

	std::shared_ptr<ColorAnimation> anmation_;
	bool anmation_change_;
};

